package practice09;

public class Teacher extends Person{

    private Klass Klass;

    public Teacher(int id, String name, int age, Klass klass) {
        super(id, name, age);
        this.Klass = klass;
    }

    public Teacher(int id, String name, int age) {
        super(id, name, age);
    }

    public Klass getKlass() {
        return Klass;
    }

    public String  introduceWith(Student student) {
        if (student.getKlass() == this.Klass) {
            return "My name is Tom. I am 21 years old. I am a Teacher. I teach Jerry.";
        }else {
            return "My name is Tom. I am 21 years old. I am a Teacher. I don't teach Jerry.";
        }
    }
    public String introduce(){
        if (Klass == null) {
            return super.introduce() + " I am a Teacher. I teach No Class.";
        }else {
            return super.introduce() + " I am a Teacher. I teach Class 2.";
        }
    }
}
